//
// Copyright (c) 2024 BPer
//
#ifndef INCLUDE_BPERUTIL_SYS_BPERCURL_H_
#define INCLUDE_BPERUTIL_SYS_BPERCURL_H_

#include <bperutil/BPerType.h>

#define BPer_Websocket_Ws 0
#define BPer_Websocket_Wss 1
#define BPer_Websocket_Http 2
#define BPer_Websocket_Https 3

typedef struct {
	int32_t netType;
	int32_t port;
	char server[30];
	char app[20];
	char stream[BPer_StreamName_Lenght];
}BPerUrlData;

//webrtc://host[:port]/app/stream
int32_t bPer_url_parse(BPerIpFamilyType familyType,char* purl, BPerUrlData* data);
//http://host:port/path ws://host:port/path wss://host:port/path
int32_t bPer_ws_url_parse(BPerIpFamilyType familyType,char* purl, BPerUrlData* data);

int32_t bPer_http_url_parse(BPerIpFamilyType familyType,char* purl, BPerUrlData* data);

#endif /* INCLUDE_BPERUTIL_SYS_BPERCURL_H_ */
